
	window.onload = function(){
		var Q = $;//jQuery.noConflict();
		divSliderClick();
		function divSliderClick(){
			  	var player  = {index:0,isNext:false},Qli_arr = Q(".nav-tabs > li");
			        Qli_arr.bind("click",function(){
			 		var Qqh = Q(".div_slider");
					if(player.isNext){
						return ;
					}												
					player.isNext = true;
		 			var num = Qqh.size();//兄弟个数
		 			var index = Q(this).index(),//当前索引
		 			indexs=Q(this).index()+1;//当前索引+1
		 			var ow = Qqh.eq(index)[0].offsetWidth;
		 			//var ol = Qqh.eq(index)[0].offsetLeft;
					var olw = player.index-index;
		 			
	 				ow = Math.abs(ow);
	 				
	 				if(olw<0){olw=-olw;}
	 				if(index < num ){//&& index >player.index
	 					if(index >player.index){
	 					Qqh.animate({
	 						left:'-='+(ow*olw)
	 					},function(){
	 						 player.index = index;
	 						 //console.dir("player.index2==========="+player.index);
	 					});}		
	 				}
	 				if(index < player.index){
		 				Qqh.animate({
		 					left:'+='+(ow*olw)
		 				},function(){
		 					 player.index = index;
		 				});
	 			  }
	 				
	 			  Q(this).addClass("active").siblings().removeClass("active");

	 			  Qli_arr.eq(index).attr("complete",1);
		 			setTimeout(function(){
		 				player.isNext= false;
		 			},600);
				  }); 
					
		 }
	}
